package Q2;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        Integer[] arr = new Integer[3 * n];
        for (int i = 0; i < 3 * n; i++) {
            arr[i] = scanner.nextInt();
        }

        /**
         * 逆序排序
         */
        Arrays.sort(arr, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2 - o1;
            }
        });

        int left = 0, right = 3 * n - 1; //left 每次向后走两步，right 每次向前走一步

        long ret = 0;
        while (left < right) {
            left++;
            ret += arr[left++];
            right--;
        }

        System.out.println(ret);
    }
}
